<template>
    <div class="goodsdesc-container">
        <h3>{{info.title}}</h3>
        <div class="content" v-html="info.content">{{info.content}}</div>
    </div>
</template>
<script>
import { Toast } from "mint-ui";

export default {
    data() {
        return {
            id:this.$route.params.id,
            info: [],//图文介绍，根据实际请求的数据情况决定用什么来将接收数据

        }
    },
    created() {
        this.getGoodsDesc();
    },
    methods: {
        getGoodsDesc(){
            this.$http.get("goodsdescData.json").then(result=>{
                console.log(this.$route.params.id);
                console.log(this.id);
                console.log(result);
                if(result.body.status===0){
                    this.info=result.body.message[0];
                }else{
                    Toast("加载商品介绍失败...");
                }
            });
        }
    },
}
</script>
<style lang="scss" scoped>
    .goodsdesc-container{
        padding: 4px;
        h3{
            font-size: 23px;
            color: #226aff;
            text-align: center;
            margin: 15px 0;
        }
        .content{
            text-indent: 2em;
            img{
                width: 100%;
            }
        }
    }
</style>